<?PHP
#
#   FILE:  Release.php (UrlChecker plugin)
#
#   Part of the Metavus digital collections platform
#   Copyright 2011-2020 Edward Almasy and Internet Scout Research Group
#   http://metavus.net
#

# ----- MAIN -----------------------------------------------------------------

use Metavus\Plugins\UrlChecker\Record;
use ScoutLib\StdLib;

PageTitle("Releasing a Resource...");
CheckAuthorization(PRIV_SYSADMIN, PRIV_COLLECTIONADMIN);

$MyPlugin = $GLOBALS["G_PluginManager"]->getPluginForCurrentPage();

$ResourceId = StdLib::getFormValue("ResourceId");
if (Record::itemExists($ResourceId)) {
    $Resource = new Record($ResourceId);
    $MyPlugin->ReleaseResource($Resource);
}

$GLOBALS["AF"]->suppressHTMLOutput();
$GLOBALS["AF"]->setJumpToPage("index.php?P=P_UrlChecker_Results");
